/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.liquidByte.trafficMustang.server.dataModel;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Alexandre
 */
@Embeddable
public class TrechoHistoricoPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "TREC_ID")
    private long trecId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "TREC_HIST_DT")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trecHistDt;

    public TrechoHistoricoPK() {
    }

    public TrechoHistoricoPK(long trecId, Date trecHistDt) {
        this.trecId = trecId;
        this.trecHistDt = trecHistDt;
    }

    public long getTrecId() {
        return trecId;
    }

    public void setTrecId(long trecId) {
        this.trecId = trecId;
    }

    public Date getTrecHistDt() {
        return trecHistDt;
    }

    public void setTrecHistDt(Date trecHistDt) {
        this.trecHistDt = trecHistDt;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) trecId;
        hash += (trecHistDt != null ? trecHistDt.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TrechoHistoricoPK)) {
            return false;
        }
        TrechoHistoricoPK other = (TrechoHistoricoPK) object;
        if (this.trecId != other.trecId) {
            return false;
        }
        if ((this.trecHistDt == null && other.trecHistDt != null) || (this.trecHistDt != null && !this.trecHistDt.equals(other.trecHistDt))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.liquidByte.trafficMustang.server.dataModel.TrechoHistoricoPK[ trecId=" + trecId + ", trecHistDt=" + trecHistDt + " ]";
    }
    
}
